package cn.gson.springboot.model.dao;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import cn.gson.springboot.model.pojos.DoctoradviceDetail;

public interface AdviceDetailsDao extends CrudRepository<DoctoradviceDetail, Integer>{

	//根据住院号查询是否有医嘱，如果有，就修改医嘱的状态为2
	@Query("SELECT d FROM DoctoradviceDetail d join d.doctorsAdvice da  join da.inhospitalReg e where e.hospId=?1 and d.docdetailsType=0")
	public DoctoradviceDetail findIfHospAdvice(String  hospId);
}
